1 /*
2  * This file is part of gtkD.
3  *
4  * gtkD is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License
6  * as published by the Free Software Foundation; either version 3
7  * of the License, or (at your option) any later version, with
8  * some exceptions, please read the COPYING file.
9  *
10  * gtkD is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with gtkD; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
18  */
19 
20 // generated automatically - do not change
21 // find conversion definition on APILookup.txt
22 // implement new conversion functionalities on the wrap.utils pakage
23 
24 
25 module gobject.Boxed;
26 
27 private import glib.Str;
28 private import gobject.c.functions;
29 public  import gobject.c.types;
30 
31 
32 /** */
33 public struct Boxed
34 {
35 
36 	/**
37 	 * Provide a copy of a boxed structure @src_boxed which is of type @boxed_type.
38 	 *
39 	 * Params:
40 	 *     boxedType = The type of @src_boxed.
41 	 *     srcBoxed = The boxed structure to be copied.
42 	 *
43 	 * Returns: The newly created copy of the boxed
44 	 *     structure.
45 	 */
46 	public static void* copy(GType boxedType, void* srcBoxed)
47 	{
48 		return g_boxed_copy(boxedType, srcBoxed);
49 	}
50 
51 	/**
52 	 * Free the boxed structure @boxed which is of type @boxed_type.
53 	 *
54 	 * Params:
55 	 *     boxedType = The type of @boxed.
56 	 *     boxed = The boxed structure to be freed.
57 	 */
58 	public static void free(GType boxedType, void* boxed)
59 	{
60 		g_boxed_free(boxedType, boxed);
61 	}
62 
63 	/**
64 	 * This function creates a new %G_TYPE_BOXED derived type id for a new
65 	 * boxed type with name @name.
66 	 *
67 	 * Boxed type handling functions have to be provided to copy and free
68 	 * opaque boxed structures of this type.
69 	 *
70 	 * For the general case, it is recommended to use G_DEFINE_BOXED_TYPE()
71 	 * instead of calling g_boxed_type_register_static() directly. The macro
72 	 * will create the appropriate `*_get_type()` function for the boxed type.
73 	 *
74 	 * Params:
75 	 *     name = Name of the new boxed type.
76 	 *     boxedCopy = Boxed structure copy function.
77 	 *     boxedFree = Boxed structure free function.
78 	 *
79 	 * Returns: New %G_TYPE_BOXED derived type id for @name.
80 	 */
81 	public static GType typeRegisterStatic(string name, GBoxedCopyFunc boxedCopy, GBoxedFreeFunc boxedFree)
82 	{
83 		return g_boxed_type_register_static(Str.toStringz(name), boxedCopy, boxedFree);
84 	}
85 
86 	/**
87 	 * Creates a new %G_TYPE_POINTER derived type id for a new
88 	 * pointer type with name @name.
89 	 *
90 	 * Params:
91 	 *     name = the name of the new pointer type.
92 	 *
93 	 * Returns: a new %G_TYPE_POINTER derived type id for @name.
94 	 */
95 	public static GType pointerTypeRegisterStatic(string name)
96 	{
97 		return g_pointer_type_register_static(Str.toStringz(name));
98 	}
99 }